{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "bbb485ba",
   "metadata": {},
   "source": [
    "## 概述\n",
    "\n",
    "seaborn 中 将分布图，分成了以下五类：\n",
    "- [displot](https://seaborn.pydata.org/generated/seaborn.displot.html#seaborn.displot)：Figure-level 接口，在 FacetGrid 上绘制分布图，最重要，其他分布图，都是调用这个函数。\n",
    "- histplot：单变量 和 双变量 直方图 分布\n",
    "- kdeplot：核密度估计 单变量 和 双变量 分布\n",
    "- ecdfplot：经验累积分布函数\n",
    "- rugplot：边缘分布\n",
    "\n",
    "\n",
    "## displot\n",
    "\n",
    "```python\n",
    "seaborn.displot(\n",
    "    data=None, x=None, y=None, hue=None, row=None, col=None, weights=None, \n",
    "    kind='hist', rug=False, rug_kws=None, log_scale=None, legend=True, \n",
    "    palette=None, hue_order=None, hue_norm=None, color=None, col_wrap=None, \n",
    "    row_order=None, col_order=None, height=5, aspect=1, facet_kws=None, **kwargs)\n",
    "```\n",
    "\n",
    "参数：\n",
    "- `data`：`pandas.DataFrame`, `numpy.ndarray`\n",
    "- `x`, `y`：指定 x 轴和 y 轴位置的变量\n",
    "- `hue`\n",
    "- `row`\n",
    "- `col`\n",
    "- `weights`\n",
    "- `kind`\n",
    "- `rug`\n",
    "- `rug_kws`\n",
    "- `log_scale`\n",
    "- `legend`\n",
    "- `palette`\n",
    "- `hue_order`\n",
    "- `hue_norm`\n",
    "- `color`\n",
    "- `facet_kws`\n",
    "- `**kwargs`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "99cc97d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.displot?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2cf222c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>total_bill</th>\n",
       "      <th>tip</th>\n",
       "      <th>sex</th>\n",
       "      <th>smoker</th>\n",
       "      <th>day</th>\n",
       "      <th>time</th>\n",
       "      <th>size</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16.99</td>\n",
       "      <td>1.01</td>\n",
       "      <td>Female</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10.34</td>\n",
       "      <td>1.66</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>21.01</td>\n",
       "      <td>3.50</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>23.68</td>\n",
       "      <td>3.31</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>24.59</td>\n",
       "      <td>3.61</td>\n",
       "      <td>Female</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   total_bill   tip     sex smoker  day    time  size\n",
       "0       16.99  1.01  Female     No  Sun  Dinner     2\n",
       "1       10.34  1.66    Male     No  Sun  Dinner     3\n",
       "2       21.01  3.50    Male     No  Sun  Dinner     3\n",
       "3       23.68  3.31    Male     No  Sun  Dinner     2\n",
       "4       24.59  3.61  Female     No  Sun  Dinner     4"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "\n",
    "tips = sns.load_dataset(\"tips\", data_home=\"data\")\n",
    "tips.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "30045616",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:visual] *",
   "language": "python",
   "name": "conda-env-visual-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
